import { Rule } from "./types";

export const SecurityRules: Rule[] = [
    {
        id: "Security/CompoundHash",
        enabled: "pending",
        descEn: "When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.",
        descCn: "",
        versionAdded: "1.28",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securitycompoundhash",
    },
    {
        id: "Security/Eval",
        enabled: true,
        descEn: "Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`, `IO.foreach`, and `IO.readlines`.",
        descCn: "",
        versionAdded: "1.22",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securityeval",
    },
    {
        id: "Security/IoMethods",
        enabled: "pending",
        descEn: "Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`, `IO.foreach`, and `IO.readlines`.",
        descCn: "",
        versionAdded: "1.22",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securityiomethods",
    },
    {
        id: "Security/JSONLoad",
        enabled: true,
        descEn: "Prefer usage of `JSON.parse` over `JSON.load` due to potential security issues. See reference for more information.",
        descCn: "",
        versionAdded: "0.43",
        versionChanged: "1.22",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securityjsonload",
    },
    {
        id: "Security/MarshalLoad",
        enabled: true,
        descEn: "Avoid using of `Marshal.load` or `Marshal.restore` due to potential security issues. See reference for more information.",
        descCn: "",
        versionAdded: "0.47",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securitymarshalload",
    },
    {
        id: "Security/Open",
        enabled: true,
        descEn: "The use of `Kernel#open` and `URI.open` represent a serious security risk.",
        descCn: "",
        versionAdded: "0.53",
        versionChanged: "1.0",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securityopen",
    },
    {
        id: "Security/YAMLLoad",
        enabled: true,
        descEn: "Prefer usage of `YAML.safe_load` over `YAML.load` due to potential security issues. See reference for more information.",
        descCn: "",
        versionAdded: "0.47",
        paramList: [],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_security.html#securityyamlload",
    },
];